/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 play_combat_walk.h

	$Header: /heroes4/play_combat_walk.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( PLAY_COMBAT_WALK_H_INCLUDED )
#define PLAY_COMBAT_WALK_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "combat_creature_handler.h"
#include "combat_path.h"
#include "counted_animation.h"
#include "counted_idle_processor.h"
#include "playing_sound_ptr.h"

class t_battlefield;
enum  t_combat_actor_action_id;
// --------------------------------------------------------------
// class to play walk animation & move actor across battlefield.
// --------------------------------------------------------------
class t_play_combat_walk : public t_counted_idle_processor, public t_counted_animation
{
public:
	t_play_combat_walk( t_combat_creature& actor,
		                t_combat_path const& path, t_combat_creature_handler handler );
	virtual ~t_play_combat_walk();
	virtual void on_idle();
protected:
	void begin_move();
	void calculate_threshold( t_combat_actor_action_id action );
	void end_move();
	void enter_tower();

	t_combat_creature&			m_actor;
	int							m_animation_distance;
	int							m_distance;
	int							m_distance_to_next_cell;
	t_combat_creature_handler	m_end_handler;
	int							m_increment;
	t_combat_path				m_path;
	t_playing_sound_ptr         m_sound;
	int                         m_step;
	int							m_sum;
	int							m_threshold;
	int							m_walk_cycles;
};

typedef t_counted_ptr< t_play_combat_walk > t_play_combat_walk_ptr;

#endif